/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package vehiculeEMF.impl;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

import vehiculeEMF.MOVEMENT_TYPE;
import vehiculeEMF.POWER_SOURCE;
import vehiculeEMF.Vehicule;
import vehiculeEMF.VehiculeEMFPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Vehicule</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link vehiculeEMF.impl.VehiculeImpl#getPowerSource <em>Power Source</em>}</li>
 *   <li>{@link vehiculeEMF.impl.VehiculeImpl#getMvt <em>Mvt</em>}</li>
 *   <li>{@link vehiculeEMF.impl.VehiculeImpl#getName <em>Name</em>}</li>
 *   <li>{@link vehiculeEMF.impl.VehiculeImpl#getMax_speed <em>Max speed</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public abstract class VehiculeImpl extends EObjectImpl implements Vehicule {
	/**
	 * The default value of the '{@link #getPowerSource() <em>Power Source</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPowerSource()
	 * @generated
	 * @ordered
	 */
	protected static final POWER_SOURCE POWER_SOURCE_EDEFAULT = POWER_SOURCE.PETROLEUM;

	/**
	 * The cached value of the '{@link #getPowerSource() <em>Power Source</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getPowerSource()
	 * @generated
	 * @ordered
	 */
	protected POWER_SOURCE powerSource = POWER_SOURCE_EDEFAULT;

	/**
	 * The default value of the '{@link #getMvt() <em>Mvt</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMvt()
	 * @generated
	 * @ordered
	 */
	protected static final MOVEMENT_TYPE MVT_EDEFAULT = MOVEMENT_TYPE.WHEELS;

	/**
	 * The cached value of the '{@link #getMvt() <em>Mvt</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMvt()
	 * @generated
	 * @ordered
	 */
	protected MOVEMENT_TYPE mvt = MVT_EDEFAULT;

	/**
	 * The default value of the '{@link #getName() <em>Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName()
	 * @generated
	 * @ordered
	 */
	protected static final String NAME_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName()
	 * @generated
	 * @ordered
	 */
	protected String name = NAME_EDEFAULT;

	/**
	 * The default value of the '{@link #getMax_speed() <em>Max speed</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMax_speed()
	 * @generated
	 * @ordered
	 */
	protected static final float MAX_SPEED_EDEFAULT = 0.0F;

	/**
	 * The cached value of the '{@link #getMax_speed() <em>Max speed</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getMax_speed()
	 * @generated
	 * @ordered
	 */
	protected float max_speed = MAX_SPEED_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected VehiculeImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return VehiculeEMFPackage.Literals.VEHICULE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public POWER_SOURCE getPowerSource() {
		return powerSource;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setPowerSource(POWER_SOURCE newPowerSource) {
		POWER_SOURCE oldPowerSource = powerSource;
		powerSource = newPowerSource == null ? POWER_SOURCE_EDEFAULT : newPowerSource;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, VehiculeEMFPackage.VEHICULE__POWER_SOURCE, oldPowerSource, powerSource));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public MOVEMENT_TYPE getMvt() {
		return mvt;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMvt(MOVEMENT_TYPE newMvt) {
		MOVEMENT_TYPE oldMvt = mvt;
		mvt = newMvt == null ? MVT_EDEFAULT : newMvt;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, VehiculeEMFPackage.VEHICULE__MVT, oldMvt, mvt));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getName() {
		return name;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setName(String newName) {
		String oldName = name;
		name = newName;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, VehiculeEMFPackage.VEHICULE__NAME, oldName, name));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public float getMax_speed() {
		return max_speed;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setMax_speed(float newMax_speed) {
		float oldMax_speed = max_speed;
		max_speed = newMax_speed;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, VehiculeEMFPackage.VEHICULE__MAX_SPEED, oldMax_speed, max_speed));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case VehiculeEMFPackage.VEHICULE__POWER_SOURCE:
				return getPowerSource();
			case VehiculeEMFPackage.VEHICULE__MVT:
				return getMvt();
			case VehiculeEMFPackage.VEHICULE__NAME:
				return getName();
			case VehiculeEMFPackage.VEHICULE__MAX_SPEED:
				return getMax_speed();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case VehiculeEMFPackage.VEHICULE__POWER_SOURCE:
				setPowerSource((POWER_SOURCE)newValue);
				return;
			case VehiculeEMFPackage.VEHICULE__MVT:
				setMvt((MOVEMENT_TYPE)newValue);
				return;
			case VehiculeEMFPackage.VEHICULE__NAME:
				setName((String)newValue);
				return;
			case VehiculeEMFPackage.VEHICULE__MAX_SPEED:
				setMax_speed((Float)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case VehiculeEMFPackage.VEHICULE__POWER_SOURCE:
				setPowerSource(POWER_SOURCE_EDEFAULT);
				return;
			case VehiculeEMFPackage.VEHICULE__MVT:
				setMvt(MVT_EDEFAULT);
				return;
			case VehiculeEMFPackage.VEHICULE__NAME:
				setName(NAME_EDEFAULT);
				return;
			case VehiculeEMFPackage.VEHICULE__MAX_SPEED:
				setMax_speed(MAX_SPEED_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case VehiculeEMFPackage.VEHICULE__POWER_SOURCE:
				return powerSource != POWER_SOURCE_EDEFAULT;
			case VehiculeEMFPackage.VEHICULE__MVT:
				return mvt != MVT_EDEFAULT;
			case VehiculeEMFPackage.VEHICULE__NAME:
				return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
			case VehiculeEMFPackage.VEHICULE__MAX_SPEED:
				return max_speed != MAX_SPEED_EDEFAULT;
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (powerSource: ");
		result.append(powerSource);
		result.append(", mvt: ");
		result.append(mvt);
		result.append(", name: ");
		result.append(name);
		result.append(", max_speed: ");
		result.append(max_speed);
		result.append(')');
		return result.toString();
	}

} //VehiculeImpl
